window.BrowserType = function() {
  var status=(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i));
    if (status) {
        if(status[0]=="iPhone"){
          return 'pc'
        }
        return 'mobile'
    } else {
        return 'PC'
    }
}



window.openWin = function(name, url, data) {

    try {
        api.openWin({
            name: name,
            url: url + '.html',
            pageParam: data,
            animation: {
                type: "none", //动画类型（详见动画类型常量）
                subType: "from_top", //动画子类型（详见动画子类型常量）
                duration: 100 //动画过渡时间，默认300毫秒
            }

        });
    } catch (err) {
        window.location.href = url + ".html";
    }
}



window.closeWin = function(name) {
    try {
        api.closeWin({
            name: name ? name : ''
        });
    } catch (err) {
        window.history.go(-1)
    }
}
